package action;

import java.util.HashMap;

import com.opensymphony.xwork2.ActionContext;

import common.BaseAction;
import entities.TMerchant;
import interfaces.IMailService;

public class GlobalAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7507534255609348887L;

	private IMailService mailService;
	private Integer mailCount;

	public String core() throws Exception {
		return SUCCESS;
	}

	public String menu() throws Exception {
		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("merNo", ((TMerchant) ActionContext.getContext().getSession().get("merchant")).getMerNo());
		paramMap.put("malRead", "0");
		paramMap.put("malState", "1");
		mailCount = mailService.record(paramMap);
		return SUCCESS;
	}

	public String foot() throws Exception {
		return SUCCESS;
	}

	////////////////////// ---------------------------//////////////////////////////////////////////////////////////////////////////////////////////////////////////
	////////////////////// ---------------------------//////////////////////////////////////////////////////////////////////////////////////////////////////////////
	////////////////////// ---------------------------//////////////////////////////////////////////////////////////////////////////////////////////////////////////

	public IMailService getMailService() {
		return mailService;
	}

	public void setMailService(IMailService mailService) {
		this.mailService = mailService;
	}

	public Integer getMailCount() {
		return mailCount;
	}

	public void setMailCount(Integer mailCount) {
		this.mailCount = mailCount;
	}

}
